package com.lyubia.shop.order.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，
 * 按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118660040";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key =
            "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbndhwuKRPp6WX4OPuXlpUDilRVv68Ev6ttNKRSzgSSVtODsAPu/AO2hQOBvlQJZAye5QBRgZwFAvU83Z3gzBaeXC/mSPJVYNUa4Ik+2qEyeHF6krCPvmtj4VTFXngfmRRzt83NkFaItmm3Qm1SLLRRfBFVlgHu4FMP/O65ucQmlN9IqZ9wMsWKD/81HBmnExX0hGy9diJjffMT9sQaq1CSRZqQz5Fta/h2ps6YRSWWQbveXorwwMTqud1XEFuIDH/8j0yfH14J7NvZCG+Y6vV8oXXl/Cy2UdQreCW4Gez/Hvg4LYdy6enkA2BU7Mhwu0JYtCOPKGvSPLBSXblHFqxAgMBAAECggEAUq05rjXUpagXTvX62OHsX3h1VYnKnEMKXZqVKt2GXlv/Y4NqCoJV/UFcC2vUr7d0cYzUSyZxhgAF9EUzdAqPSYAuUfL05farWjye4g1ELHlT5Y4uVrIejJhbOMv89eafHa0jm0VxlN1J0uejn/ueVepeabv3p/GO24W328TReA3uaNvfjrjqrIeHEq5HJ1F0AwYX7vxq2d/QDJ2FUPB2REu6UqXEG7x5qneM/PJ/EOzwXRmAxUKAC8bgoYrMEgLpcAuLLiKfwuc9PKMMURvCgC8QZ40nkioQLgr39JZrYHQ7sclo5y/1iWVDw9d4EoGgXxHN7O99Nk0xjkDluqFAAQKBgQD4QVl3TjdEFZ5N0Auh8NLerG/SqBG7D0QS7zEgoUk5RJmkMFVl8IKKGAtPVC7RWjWU3VeJR5dUIHkitubpwyxch/K7hWLno0DN7vc5OKEWpgtldWPle1J+vG5mey+L1XhVw72wNUsOP41iBsXqqqk5LgyZI/M35YH78mCYsoDl4QKBgQDid8ca0lAnUbLqRCMvMMzMFlxSaflt7mQFmzxs62sXIy9LZRfHDSRQ4YmoUxwOvNgPWhUDf4eaNzCkx/gGBRxjtzMFj2fNOW+xqe1QPZ/Y9vE/XECBGMvSn0FoLszAEqZjemLUQzjp0/nmfJhzXEVV4h72rmGL7Yd2sIC7tlpu0QKBgQC/W/gvi530IEnfJw/gazbQJ9EmayEHtNO/WJrg0RIVT7iypAMfyc2FztTg+D4CZ+vHbPptuj5+vW1CggPqiuRmCvDi9QVxEhkA5EOy2uDpCWLdeShgmrfTM0JSQoA65HiWe4R7EAlj2T8NIbVrltNMXR+e5+Qx4PpaD9G/wlCzYQKBgFF8YaLP+9E5/1N1suc++uGQRiXNRdd9SHYP9j0GtCC+Iz1Qoa6YlvGXRW3Qga732hIkCp2YnJUruJAB98dKvX1PpMciY2ofeYYGq4IMumBZ8lInAnqxDl25udIfzMJrs3zlw3u2uFrCUA/T0xLnJ3eQhi2ibyznCa/2MEvagE2RAoGBANSBlIkyRtgnyTVUgflkoLsxhaO5QYIh/fx8HF4SP1CFK+ehI0rD5wmEnlpS8a4LLGaDLewsPlIELVa2KYb6TdnrDti4QD1NAxYXIlFCGjCccjWOZgYSnwdskUdljvIfTmvD/vN/xp6s9nWOmx7KTHfxJav8tjbVJjCDY2p13i/s";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key =
            "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw+OVGotO10clRtiPx0of8ygVD+flhdT1NFPHvokQg7nPdLxUBd6w5tcgP+E4tolA8TnBMf3yT/Ekg8Tp7Bo+LVkNMrz4ybeSjSv8k0RR/AJy1j4MfUKjcb1tEok7/QDi771eUcB808gG8C+JWeYYKwJOn9VDSHCsq7rnQzTrad5J6Ukhg0SX902motOtYAVpIds/zaChzjNkmzZokfde4T2cuFWX4uEfnzAYGc7+8eI+Pn6KGSMD5z+4V9RREazZcfNdnD5E7kgAKQqorBjd/R/DwNqqJcbjs+8hN0qyeEvoiydqFGgeMi7JrBF55qZhl31EUJhldDiqsplqh+0dGQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:9094/shop-order/order/notifyCallback";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:9094/shop-order/order/returnCallback";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "F:\\尚学堂资料\\0991乐购商城\\004_reference\\alipaylog";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
